import request from '@/utils/request'

export function getGoods(params) {
  return request({
    url: '/admin/goods',
    method: 'get',
    params
  })
}
export function updateGood(id,data) {
  return request({
    url: `/admin/goods/${id}`,
    method: 'put',
    data
  })
}
export function upGood(id,data) {
  return request({
    url: `/admin/goods/${id}/status`,
    method: 'put',
    data
  })
}
export function sortGood(id,data) {
  return request({
    url: `/admin/goods/${id}/sort`,
    method: 'put',
    data
  })
}
export function goodShow(id) {
  return request({
    url: `/admin/goods/${id}/show`,
    method: 'put',
  })
}
export function addGood(data) {
  return request({
    url: '/admin/goods',
    method: 'post',
    data
  })
}
export function showGood(id) {
  return request({
    url: `/admin/goods/${id}`,
    method: 'get',
  })
}
export function deleteGood(data) {
  return request({
    url: `/admin/goods`,
    method: 'delete',
    data
  })
}
